<template>
  <el-row :gutter="20">
    <el-col :span="12">
      <div class="grid-content bg-purple">
        <div class="content ">
          <div class="header">
            <div class="title">
              运营人员(当天)
            </div>
          </div>
          <div class="body">
            <div class="stats">
              <div class="num">{{ NoRepair.total }}</div>
              <div class="text">工单总数（个）</div>
            </div>
            <div class="stats">
              <div class="num">{{ NoRepair.completedTotal }}</div>
              <div class="text">完成工单（个）</div>
            </div>
            <div class="stats">
              <div class="num">{{ NoRepair.cancelTotal }}</div>
              <div class="text">拒绝工单（个）</div>
            </div>
            <div class="stats">
              <div class="num">{{ NoRepair.workerCount }}</div>
              <div class="text">运营人员数（个）</div>
            </div>
          </div>
        </div>
      </div>
    </el-col>
    <el-col :span="12">
      <div class="grid-content bg-purple">
        <div class="content content2">
          <div class="header">
            <div class="title">
              运维人员(当天)
            </div>
          </div>
          <div class="body ">
            <div class="stats">
              <div class="num  color2">{{ isRepair.total }}</div>
              <div class="text color3">工单总数（个）</div>
            </div>
            <div class="stats">
              <div class="num color2">{{ isRepair.completedTotal }}</div>
              <div class="text color3">完成工单（个）</div>
            </div>
            <div class="stats">
              <div class="num color2">{{ isRepair.cancelTotal }}</div>
              <div class="text color3">拒绝工单（个）</div>
            </div>
            <div class="stats">
              <div class="num color2">{{ isRepair.workerCount }}</div>
              <div class="text color3">运维人员数（个）</div>
            </div>
          </div>
        </div>
      </div>
    </el-col>
  </el-row>
</template>

<script>
import { taskReportInfo } from '@/api'
import { parseTime } from '@/utils'
export default {
  data() {
    return {
      isRepair: {},
      NoRepair: {}
    }
  },
  async created() {
    const res = await taskReportInfo(parseTime(new Date(), '{y}-{m}-{d} 00:00:00'), parseTime(new Date(), '{y}-{m}-{d} 23:59:59'))
    res.data.forEach(item => {
      if (item.repair) {
        this.isRepair = item
      } else {
        this.NoRepair = item
      }
    })
  }
}
</script>

<style lang="scss" scoped>
@import "~@/styles/count.scss";
// .el-col-12{
//   padding-left:10px;
// }
.content2{
  background: #fbefe8 url(http://likede2-admin.itheima.net/img/sale.606b0d8c.png) no-repeat calc(100% - 12px) 100%;
}
.color2{
  color: #ff5757 !important;
  text-shadow: 2px 4px 7px rgb(255 99 85 / 50%) !important;
}
.color3{
  color: #de9690 !important;
}
</style>
